<%-- 
    Document   : showSportCamp
    Created on : 24-mag-2014, 19.53.23
    Author     : Fede programmer
--%>

<%@page import="entity.Campo"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="CSS/BaseSite.css" />   
        <link rel="stylesheet" type="text/css" href="CSS/vertical-ticker.css"/>      
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
        <script type="text/javascript" src="JQuery/jquery.totemticker.js"></script>
        <script type="text/javascript" src="JQuery/chainedmenu.js"></script>
        <script type="text/javascript" src="JQuery/config.js"></script>
        <script type="text/javascript" src="JQuery/jquery.pajinate.js"></script>
        
        <link rel="shortcut icon" href= "Images/stadion-icon.png"/>
        <script type="text/javascript">
            $(document).ready(function() {
                $('#paging_container2').pajinate({
                    nav_label_first: '<<',
                    nav_label_last: '>>',
                    nav_label_prev: '<',
                    nav_label_next: '>'
                });
            });
        </script>        
        <script type="text/javascript">
            $(document).ready(function() {
                $('li:odd, .paging > *:odd');
            });
        </script>       
        <title>Lista campi</title>
    </head>   
    <div class="main">
        <div class="page">
            <div class="header">       
                <div class="login">
                    <%@include file="login.jsp"%>
                </div>
                <div class="banner">
                </div>
                <div class="topmenu">
                    <%@include file="topmenu.jsp" %>
                </div>
            </div>
            <div class="content">
                <div class="content-in">
                    <div class="left-panel">
                        <div class="left-panel-in">
                            <%
                                String sport = (String) request.getAttribute("sport");
                                String op = (String) request.getAttribute("op");
                                List<Campo> listaCampi = (List<Campo>) request.getAttribute("listacampi");

                                if (op.equals("visualizzaElencoCampi")) {%>
                            <%if (listaCampi.size() != 0) {%>
                            <div id="paging_container2">			               
                                <ul class="paging"> 
                                    <%
                                        for (int i = 0; i < listaCampi.size(); ++i) {%>                                                       
                                    <form action="GeneralController" method="post">
                                        <input type="hidden" name="idcampo" value="<%=listaCampi.get(i).getId()%>">
                                        <li>
                                            <table style="margin-left:auto; margin-right:auto;" width="550px" class="elencoCampi"border="0" align="center">
                                                <tr>
                                                    <th rowspan="6" scope="col" align="center">        
                                                        <a href="/mfm-centro-sportivo-war/GeneralController?submit=visualizzaSingoloCampo&idcampo=<%=listaCampi.get(i).getNumeroCampo()%>">
                                                            <img src="Campi/<%=listaCampi.get(i).getSport()%>-<%=listaCampi.get(i).getTipoTerreno()%>.png" width="200" heigth="200"/>    
                                                        </a>                                                           
                                                    </th>
                                                    <th colspan="2" align="left" scope="col">
                                                        <section class="insertModule">            
                                                            <h1 align="left">Dettagli Campo</h1>
                                                        </section>
                                                    </th>
                                                </tr>
                                                <tr>
                                                    <th align="left" scope="col">
                                                        <div align="right">
                                                            <div class="titoloCampi">
                                                                Superfice:
                                                            </div>                                                                        
                                                        </div>
                                                    </th>
                                                    <th align="left" scope="col">
                                                        <%=listaCampi.get(i).getTipoTerreno()%>
                                                    </th>
                                                </tr>
                                                <tr>
                                                    <th align="left" scope="col">
                                                        <div align="right">
                                                            <div class="titoloCampi">
                                                                Copertura:
                                                            </div>                                                                    
                                                        </div>
                                                    </th>
                                                    <th align="left" scope="col">
                                                        <img src="Campi/coperto.png">
                                                    </th>
                                                </tr>
                                                <tr>
                                                    <th align="left" scope="col">
                                                        <div align="right">
                                                            <div class="titoloCampi">
                                                                Prenotazione:
                                                            </div>
                                                        </div>
                                                    </th>
                                                    <th align="left" scope="col">Disponibile</th>
                                                </tr>
                                                <tr>
                                                    <th align="left" scope="col">
                                                <div align="right">
                                                    <div class="titoloCampi">
                                                        Prezzo:
                                                    </div>                                                                        
                                                </div>
                                                </th>
                                                <th align="left" scope="col">
                                                    <%=listaCampi.get(i).getPrezzo()%> euro/h 
                                                </th>
                                                </tr>
                                                <tr>
                                                    <th width="109" align="left" scope="col">
                                                <div align="right">
                                                    <div class="titoloCampi">
                                                        N° Campo:
                                                    </div>                                                                        
                                                </div>
                                                </th>
                                                <th width="212" align="left" scope="col">
                                                    <%=listaCampi.get(i).getNumeroCampo()%>
                                                </th>
                                                </tr>
                                                <tr style="border-bottom:1px solid #1a82f7;">
                                                    <td height="23">
                                                        <div align="center" style="padding:10px;">
                                                        <input type="hidden" name="idcampo" value="<%=listaCampi.get(i).getId()%>"/>
                                                        <input type="hidden" name="nCampo" value="<%=listaCampi.get(i).getNumeroCampo()%>"/>
                                                            <button type="submit" class="myButton blue" id="btnsubmit" name="submit" value="prenotaSingoloCampo">
                                                                PRENOTA
                                                            </button>                        
                                                        </div>
                                                    </td>
                                                    <td colspan="2">
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                            </table>
                                        </li>
                                    </form>                    
                                    <%}%> 
                                </ul>					                                
                                <div class="page_navigation">                                    
                                </div>                               
                            </div>                   
                            <%}
                            } else if (op.equals("visualizzaSingoloCampo")) {
                                Campo campo = (Campo) request.getAttribute("campo");                                
                            %>
                            <form action="GeneralController" method="post">
                                <input type="hidden" name="idcampo" value="<%=campo.getId()%>">
                                <div align="center"><h1>Informazioni Campo n°<%=campo.getNumeroCampo()%></h1></div><br/><br/>
                                <fieldset style="border:groove; margin-left:50px;">
                                    <table width="620" height="349" border="0">
                                        <tr>
                                            <th width="250" rowspan="10" scope="col">
                                                <a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">
                                                    <img class="imageborder" src="<%=campo.getImmagine()%>" width="400" height="400"/>
                                                </a>                                                                                                                                               
                                            </th>
                                            <th height="30" colspan="2" align="left" scope="col">
                                        <div class="titoloCampiB">
                                            Prenota:
                                        </div>
                                        </th>
                                        </tr>
                                        <tr>
                                            <th height="62" colspan="2" align="left" scope="col">
                                        <div align="center">
                                            <input type="hidden" name="idcampo" value="<%=campo.getId()%>"/>
                                            <input type="hidden" name="nCampo" value="<%=campo.getNumeroCampo()%>"/>
                                            <button type="submit" class="myButton blue" id="btnsubmit" name="submit" value="prenotaSingoloCampo">
                                                PRENOTA
                                            </button>  
                                        </div>
                                        </th>
                                        </tr>
                                        <tr>
                                            <th colspan="2" align="left" scope="col">
                                                <div class="titoloCampiB">
                                                    Dettagli:
                                                </div>
                                            </th>
                                        </tr>
                                        <tr>
                                            <th align="left" scope="col">
                                                <div align="left">
                                                    <div class="titoloCampi">
                                                        Superficie:
                                                    </div>                                                 
                                                </div>
                                            </th>
                                            <th align="left" scope="col">
                                                <%=campo.getTipoTerreno()%>
                                                <span class="camp_icon <%=campo.getTipoTerreno()%>"></span>
                                            </th>
                                        </tr>
                                        <tr>
                                            <th align="left" scope="col">
                                                <div align="left">
                                                    <div class="titoloCampi">
                                                        Copertura:
                                                    </div>                                                  
                                                </div>
                                            </th>
                                            <th align="left" scope="col">
                                                chiuso
                                            </th>
                                        </tr>
                                        <tr>
                                            <th align="left" scope="col">
                                                <div class="titoloCampi">
                                                    Disponibilità:
                                                </div>
                                            </th>
                                            <th align="left" scope="col">
                                                disponibile
                                            </th>
                                        </tr>
                                        <tr>
                                            <th width="130" align="left" scope="col">
                                                <div align="left">
                                                    <div class="titoloCampi">
                                                        Prezzo:
                                                    </div>                                              
                                                </div>
                                            </th>
                                            <th width="179" align="left" scope="col"><%=campo.getPrezzo()%>0€</th>
                                        </tr>
                                        <tr>
                                            <th height="23" align="left" scope="col">
                                                <div align="left">
                                                    <div class="titoloCampi">
                                                        Numero spettatori:
                                                    </div>                                                            
                                                </div>
                                            </th>
                                            <th align="left" scope="col"><%=campo.getNumeroSpettatori()%></th>
                                        </tr>
                                        <tr>
                                            <td height="23" colspan="2">
                                                <div class="titoloCampiB">
                                                    <strong>
                                                        Servizi Offerti:
                                                    </strong>
                                               </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td height="61" colspan="2">
                                            <%
                                                String[] servizi = (String[]) request.getAttribute("servizi");
                                                for (String ser : servizi) {%>
                                                    <img class="shadow" src="Campi/<%=ser%>.png" title="<%=ser%>"/>
                                          <%}%>
                                            </td>
                                        </tr>
                                    </table>                                            
                                </fieldset>
                            </form> 
                            <div id="light" class="white_content">
                                <img src="<%=campo.getImmagine()%>" height="480" width="480"/>
                                <a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">
                                    <img src="Images/close-pop.png" class="cbutton" title="Close Window" />
                                </a>
                            </div>
                            <div id="fade" class="black_overlay"></div>   
                            <%}%>
                        </div>
                    </div>                         
                    <div class="right-panel">
                        <div class="right-panel-in">
                            <jsp:include page="/GeneralController">
                                <jsp:param name="submit" value="right-content"/>
                                <jsp:param name="op" value="newsbox"/>
                            </jsp:include>
                        </div>
                    </div>                   
                </div>
            </div>
            <div class="footer">
                 <%@include file="footer.jsp" %>
            </div>            
        </div>
    </div>
</body>   
</html>
